import request from '@/utils/request';
import { getRequest, postRequest, putRequest, deleteRequest } from '@/utils/request';

// 创建员工
export function createEmp(data) {
	return request({
		url: '/system/emp/create',
		method: 'post',
		data: data
	});
}

// 更新员工
export function updateEmp(data) {
	return request({
		url: '/system/emp/update',
		method: 'put',
		data: data
	});
}

// 删除员工
export function deleteEmp(id) {
	return request({
		url: '/system/emp/delete?id=' + id,
		method: 'delete'
	});
}

// 获得员工
export function getEmp(id) {
	return request({
		url: '/system/emp/get?id=' + id,
		method: 'get'
	});
}

// 获得员工分页
export function getEmpPage(query) {
	return request({
		url: '/system/emp/page',
		method: 'get',
		params: query
	});
}

// 导出员工 Excel
export function exportEmpExcel(query) {
	return request({
		url: '/system/emp/export-excel',
		method: 'get',
		params: query,
		responseType: 'blob'
	});
}
// 批量创建和验证
export const systemEmpBatchCreate = (params) => postRequest('/system/emp/batch-create', params);
export const systemEmpBatchValid = (params) => postRequest('/system/emp/batch-valid', params);

// 清楚员工的班组信息
export const systemEmpClearGroup = (data, params) => putRequest('/system/emp/clear-group', data, params);
// 在职和复职的状态修改
export const systemEmpUpdateJob = (params) => postRequest('/system/emp/update-job', params);
